package com.erp.warehouse.clouderp_warehouse.service.impl.inventory;

import com.erp.warehouse.clouderp_warehouse.mapper.inventory.InventoryMapper;
import com.erp.warehouse.clouderp_warehouse.service.inventory.InventoryService;
import org.comple.erp.pojo.warehouse.Inventory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;
import java.util.UUID;

/**
 * 2025/11/6 8:58
 * author: 向远洋
 */
@Service
@Transactional
public class InventoryServiceImpl implements InventoryService {
    @Autowired
    InventoryMapper inventoryMapper;

    @Override
    public List<Inventory> getAllStockList(Map<String, Object> params) {

        return inventoryMapper.selectInventoryList(params);
    }

    @Override
    public List<String> getLockedGoodsIdList() {
        return inventoryMapper.selecteLockedGoodsIdList();
    }

    @Override
    public boolean initGoodsStock(Map<String, Object> params) {
        params.put("id", UUID.randomUUID().toString());
        return inventoryMapper.insertByMap(params) == 1;
    }
}
